﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using FreeSql.DataAnnotations;
using Newtonsoft.Json;

namespace lruc.Model
{
    [Table(Name = "user")]
    public class User
    {
        [Column(IsIdentity = true, IsPrimary = true, Name = "id")]
        [JsonProperty("id")]
        public long Id { get; set; }

        [Column(Name = "username")]
        [JsonProperty("username")]
        public string Username { get; set; }

        [Column(Name = "password")]
        [JsonProperty("password")]
        public string Password { get; set; }

        [Column(Name = "nickname")]
        [JsonProperty("nickname")]
        public string Nickname { get; set; }

        [Column(Name = "sex")]
        [JsonProperty("sex")]
        public string Sex { get; set; }

        [Column(Name = "email")]
        [JsonProperty("email")]
        public string Email { get; set; }

        [Column(Name = "token")]
        [JsonProperty("token")]
        public string Token { get; set; }

        [Column(Name = "created", ServerTime = DateTimeKind.Local, CanUpdate = false, DbType = "datetime(0) NOT NULL")]
        [JsonProperty("created")]
        public DateTime CreateTime { get; set; }

        [Column(Name= "updated", ServerTime = DateTimeKind.Local, DbType = "datetime(0) NOT NULL")]
        [JsonProperty("updated")]
        public DateTime UpdateTime { get; set; }
    }
}
